#ifndef MULTIDISPLAY_H
#define MULTIDISPLAY_H

#include "global.h"
#include "previewscr.h"
#include "displaywidget.h"
#include <QtGui/QMainWindow>
#include <QLabel>
#include <QDesktopWidget>
#include <QList>
#include <QHBoxLayout>
#include <QCheckBox>
#include <QAction>
#include <QTimer>

class MultiDisplay : public QMainWindow
{
    Q_OBJECT

public:
    MultiDisplay(QWidget *parent = 0);
    ~MultiDisplay();

    void initialize();
    void createInterface();
    QGridLayout *createPreviews();
    QVBoxLayout *createTaskPanel();
    void checkDisplay(int scrNum);
    void createAction();

private:
    QLabel *displayMsg;
    QLabel *imageLabel;

    QList <PreviewScr *> *previewList;
    QList <QCheckBox *> *projectorList;
    QList <DisplayWidget *> *displayList;

//    QAction *actDrawImage;

    QDesktopWidget desktop;
    int numScreens;
    QTimer * myTimer;

    void showImageonDisplay(int proNum, QString imgPath);
    void showClockonDisplay(int proNum);

public slots:
    void on_refresh();
    void on_image();
    void on_clock();
    void on_closeAll();
    void on_exit();

    void ac_DrawImage(int num);
    void ac_ShowClock(int num);
};

#endif // MULTIDISPLAY_H
